@echo off
setlocal EnableDelayedExpansion
set WSS_HOME=%~dp0
set AutoRunBat=%WSS_HOME%main_entry.bat
call %AutoRunBat%
rem 管理员权限检查
fltmc >nul 2>&1
if "!errorlevel!" equ "1" (
  goto:UpdateScriptSet 
) else (
  goto:InstallScriptSet
)

pause
goto :eof

:InstallScriptSet
setx WSS_HOME %~dp0
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%AutoRunBat%" /f
if !errorlevel! equ 0 (
  echo.
  echo.  Succeed to install windows script set.
) else (
  echo.
  echo.  Failed to install windows script set.
  echo.  This script must be run as an administrator.
)
goto:eof

:UpdateScriptSet
echo.  Succeed to update windows script set.
goto :EOF


pause